package com.jx.driving.transmission;

import java.util.Arrays;

import com.jx.driving.message.TimeTerminalTransmissionMessage;
import com.jx.driving.protocol.terminal.annotation.ByteAnnotation;
import com.jx.driving.protocol.terminal.annotation.DynamicByteArrayAnnotation;
import com.jx.driving.protocol.terminal.annotation.LimitedStringAnnotation;
import com.jx.driving.protocol.terminal.annotation.TerminalAnnotation;
import com.jx.driving.protocol.terminal.annotation.WordAnnotation;

/**
 * 学员登录应答
 * 
 * @author shenliuyang
 *
 *         2016年8月15日上午10:08:48
 */
@TerminalAnnotation
public class Terminal0x8201Transmission extends TimeTerminalTransmissionMessage {
    @ByteAnnotation(order = 1)
    private short result;// 登录结果1：登录成功；2：无效的学员编号；3：禁止登录的学员；4：区域外教学提醒；5：准教车型与培训车型不符；9：其他错误
    @LimitedStringAnnotation(value = 16, order = 2)
    private String userNo;// 学员编号
    @WordAnnotation(order = 3)
    private int totalTraningTime;// 总培训学时
    @WordAnnotation(order = 4)
    private int currentCompletedTime;// 当前培训部分已完成学时
    @WordAnnotation(order = 5)
    private int courseMileage;// 总培训里程
    @WordAnnotation(order = 6)
    private int currentCompletedMileage;// 当前培训部分已完成里程
    @ByteAnnotation(order = 7)
    private short attachemetable;// 是否附加消息
    @DynamicByteArrayAnnotation(value = 1, order = 8)
    private byte[] attachement;// 附加消息

    public short getResult() {
	return result;
    }

    public void setResult(short result) {
	this.result = result;
    }

    public String getUserNo() {
	return userNo;
    }

    public void setUserNo(String userNo) {
	this.userNo = userNo;
    }

    public int getTotalTraningTime() {
	return totalTraningTime;
    }

    public void setTotalTraningTime(int totalTraningTime) {
	this.totalTraningTime = totalTraningTime;
    }

    public int getCurrentCompletedTime() {
	return currentCompletedTime;
    }

    public void setCurrentCompletedTime(int currentCompletedTime) {
	this.currentCompletedTime = currentCompletedTime;
    }

    public int getCourseMileage() {
	return courseMileage;
    }

    public void setCourseMileage(int courseMileage) {
	this.courseMileage = courseMileage;
    }

    public int getCurrentCompletedMileage() {
	return currentCompletedMileage;
    }

    public void setCurrentCompletedMileage(int currentCompletedMileage) {
	this.currentCompletedMileage = currentCompletedMileage;
    }

    public short getAttachemetable() {
	return attachemetable;
    }

    public void setAttachemetable(short attachemetable) {
	this.attachemetable = attachemetable;
    }

    public byte[] getAttachement() {
	return attachement;
    }

    public void setAttachement(byte[] attachement) {
	this.attachement = attachement;
    }

    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("Terminal0x8201Transmission [result=").append(result).append(", userNo=").append(userNo)
		.append(", totalTraningTime=").append(totalTraningTime).append(", currentCompletedTime=")
		.append(currentCompletedTime).append(", courseMileage=").append(courseMileage)
		.append(", currentCompletedMileage=").append(currentCompletedMileage).append(", attachemetable=")
		.append(attachemetable).append(", attachement=").append(Arrays.toString(attachement)).append("]");
	return builder.toString();
    }

}
